//
//  UnzipTabViewCell.swift
//  ZipTools
//
//  Created by 齐庆斌 on 2018/4/13.
//  Copyright © 2018年 齐庆斌. All rights reserved.
//

import UIKit

protocol ZipDelegate {
    // 开始解压
    func startUnzip(cell: UnzipTabViewCell)
}

class UnzipTabViewCell: UITableViewCell {
    
    var delegate: ZipDelegate?
    var filesPaths: (UnzipData, Bool)? {
        didSet{
            setUpUI()
        }
    }
    
    @IBOutlet weak var filesPath: UILabel!
    
    @IBOutlet weak var ZipButton: UIButton!
    
    func setUpUI() {
        filesPath.text = filesPaths?.0.path
        
        let title = (filesPaths?.1)! ? "解压" : "压缩"
        ZipButton.setTitle(title, for: .normal)
        
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    @IBAction func goToUnzip(_ sender: Any) {
        print("start!")
        delegate?.startUnzip(cell: self)
    }
    
    
}
